package nsip.scheduling;

import java.util.Comparator;
import nsip.model.Item;

/**
 *
 * @author Markus Goetz
 */
public class DeadlineComparator implements Comparator<Item> {
    @Override
    public int compare(Item item1, Item item2) {
        int deadline1 = item1.getProductionDueDate();
        int deadline2 = item2.getProductionDueDate();

        if (deadline1 < deadline2) {
            return -1;
        } else if (deadline1 == deadline2) {
            return 0;
        } else {
            return 1;
        }
    }
}
